package com.ruoyi.procured.service;

import com.ruoyi.procured.domain.PaymentRequest;
import com.ruoyi.procured.domain.PaymentReturn;
import com.ruoyi.procured.domain.vo.ProcuredOrderAmountDTO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 申请付款Service接口
 * 
 * @author 刘广帆
 * @date 2024-10-03
 */
public interface IPaymentRequestService
{
    /**
     * 最大可申请多少钱
     * @param ordersId
     * @return
     */
    public ProcuredOrderAmountDTO selectProcuredOrderAmountDueById(String ordersId);

    /**
     * 新增申请付款
     * @param paymentRequest 申请应付款
     * @return 结果
     */
    public int insertPaymentRequestQuash(PaymentRequest paymentRequest, String procuredOrderId, Long userId, String componentPath);

    /**
     * 查询该采购下所申请的记录数据
     * @param paymentRequest
     * @return
     */
    public List<PaymentRequest> selectPaymentRequestList(PaymentRequest paymentRequest);

    /**
     * 取消申请
     * @param paymentRequestIds
     * @return
     */
    public int setCancelPaymentRequestByIds(List<String> paymentRequestIds, String nickname);

    /**
     * 查询审核记录
     * @return
     */
    public List<PaymentRequest>  selectPaymentRequestByStatus(Long reviewStatus, Long deptId, Long userId, String applicant);
    /**
     * 申请退款
     * @param paymentRequest
     * @return
     */
    int insertPaymentReturnQuash(PaymentRequest paymentRequest, String procuredOrderId, Long userId, String componentPath);
    /**
     * 申请退款，更新商品库存锁定
     * @return
     */
    public void lockReservedQuantity(List<PaymentReturn> items, Long procuredOrderId);
}
